<?php echo $this->headLink()->appendStylesheet($this->css('cmxformTemplate.css'))
	->appendStylesheet($this->css('cmxform.css'))?>
	<?php echo $this->headScript()
	->appendFile($this->js('jquery-validate/jquery.validate.min.js'))
	->appendFile($this->js('jquery-validate/localization/messages_tw.js'))
	->appendFile($this->js('plugins/jquery.form.js'))
	->captureStart();
?>
// 測試連線
var testdb = function(){

		var v = jQuery("#testForm").validate({
			submitHandler: function(form) {

			}
		});
}


$(document).ready(function(){
	var options = {
	       dataType:  'json',
	       success: function(data){
  			alert(data.msg);
        }
	}

	$('#testForm').ajaxForm(options);

	$("#testbtn").click(function(){
		if ($("#testForm").validate().form()){
			$('#testForm').submit();
		}

	});
});
<?php echo $this->headScript()->captureEnd() ?>
<?php echo $this->headStyle()->captureStart();?>
#testForm { width: 600px; }
#testForm label.error {
	margin-left: 10px;
	width: auto;
	display: inline;
}

<?php echo $this->headStyle()->captureEnd() ?>

<div id="loader"></div>
<div class="main_body" id="main_body">

<form class="cmxform" id="testForm" method="post" action="<?php echo $this->route('setdb')?>"  style="display: block;">
<fieldset>
   <legend>SFS3 資料庫設定</legend>
   <p>
     <label for="host">資料庫位址 *</label>
     <input id="host" name="host" size="20" class="required"/>
   </p>
   <p>
     <label for="user">使用者帳號 *</label>
     <input type="text" id="user" name="user" size="20"  class="required" value="" />
   </p>
   <p>
     <label for="user">使用者密碼 *</label>
     <input type="password" id="password" name="password" size="20"  class="required" value="" />
   </p>
    <p>
     <label for="dbname">資料庫名稱 *</label>
     <input type="text" id="dbname" name="dbname" size="20"  class="required" value="" />
   </p>
   <p>
   	<input class="submit" type="button" id="testbtn" value="測試連線" />
   </p>
 </fieldset>

</form>
</div>